<?php
use \Workerman\Autoloader;

require_once __DIR__ . '/../../../../../Workerman/Autoloader.php';
require_once __DIR__.'/../../../Config/Const.php';
Autoloader::setRootPath(__DIR__.'/../../..');

$page_groupId = GROUP_STATISTICS_MNG;
$page_pageId = PAGE_STATISTICS_RESTAURANT_DAY_TURNOVER;

require "../framepages/moudle_base.php";

$date = $_POST['date'];
if (!$date) {
    $date = date('Y-m-d');
}


?>
<script type="text/javascript" src="../../src/js/My97DatePicker/WdatePicker.js"> </script>

<div class="main-content">
    <div>

        <table width="100%">
            <form method="post" action="">
                <tr>
                    <th width="13%">日期 &nbsp;<input type="text" name="date" id="date" size="10" onClick="WdatePicker()" readonly="readonly" value="<?php echo $date ?>"></th>
                    <th width="13%">商铺id</th>
                    <th>营业额</th>
                    <th><input type="submit" class="btn btn-danger" value="查询"></th>
                </tr>

            </form>
            <?php
            $statistics_restaurant_day_turnover_list = \Data\Statistics_restaurant_day_turnover_DAO::getList($date);
            foreach ($statistics_restaurant_day_turnover_list as $statistics_restaurant_day_turnover_record) {
                $date = $statistics_restaurant_day_turnover_record->getDATE();
                $restaurant_id = $statistics_restaurant_day_turnover_record->getRESTAURANT_ID();
                $turnover = $statistics_restaurant_day_turnover_record->getTURNOVER();

                echo "
                        <tr>
                            <td>$date</td>                      
                            <td>$restaurant_id</td>
                            <td>$turnover</td>
                        </tr>
                        ";

            }
            ?>
        </table>

    </div>
    <?php
    require "../framepages/footer.php";
    ?>
</div>
</div>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
</body>
</html>